<template>
	<div class="wrapper">
		<p>公司名称：{{storeData.merchant_name}}</p>
		<p>公司地址：{{storeData.detail_address}}</p>
		<u-image @click="preview()" width="100%" height="400rpx" mode="aspectFit" :src="storeData.merchant_img"></u-image>
	</div>
</template>

<script>
	import {
		merchantDetail
	} from "@/api/goods.js";
	export default {
		data() {
			return {
				storeData: {},
			};
		},
		onLoad(options) {
			this.getStoreData(options.id);
		},
		methods: {
			async getStoreData(id) {
				let res = await merchantDetail({
					id: id
				});
				if (res.code === 1) {
					this.storeData = res.data.merchant;
				}
			},

			/**
			 * 点击图片放大或保存
			 */
			preview() {
				uni.previewImage({
					current: 0,
					urls: [this.storeData.licencePhoto],
					longPressActions: {
						itemList: ["保存图片"],
						success: function(data) {},
						fail: function(err) {},
					},
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	.wrapper {
		padding: 32rpx;

		>p {
			margin: 20rpx 0;
		}
	}
</style>